package cn.mayaslight.wechat.api;

import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;

import cn.mayaslight.common.handler.LocalHttpClient;
import cn.mayaslight.wechat.api.bean.Ticket;

public class TicketAPI extends BaseAPI{

	public static Ticket ticket(boolean isQy, String access_token){
		HttpUriRequest httpUriRequest = RequestBuilder.get()
				.setUri(BASE_URI + "/cgi-bin/ticket/getticket")
				.addParameter("access_token",access_token)
				.addParameter("type", "jsapi")
				.build();
		return (Ticket) LocalHttpClient.executeJsonResult(httpUriRequest,Ticket.class);
	}
}
